<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Game {
            constructor(name, type, nikename) {
                this.name = name
                this.type = type
                this.nikename = nikename
            }

            say() {
                // console.log(this)
                console.log('欢迎进入' + this.nikename)
            }
        }

        // var game = new Game('Lol', "端游", '英雄联盟')
        // game.say()

        class Hero extends Game {
            constructor(name, type, nikename, heroName) {
                super(name, type, nikename)
                this.heroName = heroName
            }
            dance() {
                console.log('跳舞')
            }
        }

        var hero = new Hero('Lol', "端游", '英雄联盟', '喜之郎')
        console.log(hero)
    </script>
</body>
</html>